﻿using Learun.Util.SqlSugar;
using Learun.Util;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;

namespace Learun.Application.TwoDevelopment.ZZDT_EC
{
    /// <summary>
    /// 版 本 PIT-ADMS V7.0.3 敏捷开发框架
    /// Copyright (c) 2013-2018 Hexagon PPM
    /// 创 建：超级管理员
    /// 日 期：2022-06-21 15:32
    /// 描 述：箱柜表
    /// </summary>
    public class ec_OPCService
    {
        #region 仓储
        Repository<ec_projectEntity> _projectRepository => new Repository<ec_projectEntity>();
        Repository<ec_OPCEntity> _OPCRepository => new Repository<ec_OPCEntity>();
        #endregion
        #region 获取数据
        /// <summary>
        /// 获取列表数据
        /// <summary>
        /// <returns></returns>
        public List<ec_OPCEntity> GetList(string projId)
        {
            try
            {
                if (string.IsNullOrEmpty(projId))
                {
                    return null;
                }
                else
                {
                    var tbName = ProjectSugar.TableName<ec_OPCEntity>(projId);
                    return _OPCRepository.AsQueryable().AS(tbName).ToList();
                }

            }
            catch (Exception ex)
            {
                if (ex is ExceptionEx)
                {
                    throw;
                }
                else
                {
                    throw ExceptionEx.ThrowServiceException(ex);
                }
            }
        }

 
        #endregion


    }
}
